<template>
  <div class="kgo-editor-wangEditor">
        <div id="editorElem" style="text-align:left"></div>
  </div>
</template>

<script>

import Edit from 'wangeditor'
export default {
   props:{
      name:{
          default:"name"
      },
      content:{
        default:null
      }
    },
     data () {
        return {
            editor:null,
        }
    },
   mounted(){
        layui.element.init();
        this.editor = new Edit('#editorElem');
         this.editor.customConfig.onchange = (html) => {
        }
        this.editor.create();
        if(this.content!=null){
          this.editor.txt.html(this.content);
        }

   },
   methods:{
      getHtml:function(){
          this.$emit('Html',this.editor.txt.html())//将值绑定到transfer上传递过去
          return this.editor.txt.html();
      },
      emptyEdit:function(){
        this.editor.txt.html("");
      }
   }
}
</script>

<style lang="scss">
.kgo-editor-wangEditor{
    width: 100%;
    background-color: #ffffff;
    min-height: 650px;
}
//修改富文本编辑器的高度
.w-e-text-container{
    height: 600px !important;
}
#editorElem{
    width: 100%;
    margin: 0 auto;
}

</style>
